mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Initial commit
This commit is contained in:
commit
3c7cc0c973
8391 changed files with 704313 additions and 0 deletions
|
@ -0,0 +1,16 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class BasicCameraFollow : MonoBehaviour
|
||||
{
|
||||
public GameObject followTarget;
|
||||
private Vector3 targetPos;
|
||||
public float moveSpeed;
|
||||
|
||||
void Update ()
|
||||
{
|
||||
targetPos = new Vector3(followTarget.transform.position.x, followTarget.transform.position.y, transform.position.z);
|
||||
Vector3 velocity = targetPos - transform.position;
|
||||
transform.position = Vector3.SmoothDamp (transform.position, targetPos, ref velocity, 1.0f, moveSpeed * Time.deltaTime);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6992f49c3fd3c4795a3c9f80850a68d4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.U2D;
|
||||
|
||||
public class CameraManager : MonoBehaviour
|
||||
{
|
||||
public Camera ordinaryCamera;
|
||||
public PixelPerfectCamera pixelPerfectCamera;
|
||||
|
||||
private bool isPixelPerfect;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
isPixelPerfect = false;
|
||||
ValidateCameras(isPixelPerfect);
|
||||
}
|
||||
|
||||
public void TogglePixelPerfect(bool value)
|
||||
{
|
||||
isPixelPerfect = value;
|
||||
ValidateCameras(isPixelPerfect);
|
||||
}
|
||||
|
||||
public void ValidateCameras(bool value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
ordinaryCamera.gameObject.SetActive(false);
|
||||
pixelPerfectCamera.gameObject.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ordinaryCamera.gameObject.SetActive(true);
|
||||
pixelPerfectCamera.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 34e749f8e89764026b0bcd4ced153c5f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,26 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class HeroMover : MonoBehaviour
|
||||
{
|
||||
public float Amplitude = 1.0f;
|
||||
public float Frequency = 1.0f;
|
||||
|
||||
private Vector3 origin;
|
||||
private float offset;
|
||||
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
origin = transform.position;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
offset = Mathf.Sin(Time.time * Frequency * 4.0f) * Amplitude;
|
||||
transform.position = origin + Vector3.right * offset;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c009ff863a0ae4c33809953147cc9fee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue