suck it unity collab
This commit is contained in:
parent
2630db1920
commit
dad44ef0cf
456 changed files with 1861 additions and 128 deletions
20
Assets/RealCode/Animations/SimpleAnimationLoop.cs
Normal file
20
Assets/RealCode/Animations/SimpleAnimationLoop.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SimpleAnimationLoop : MonoBehaviour {
|
||||
|
||||
private new SpriteRenderer renderer;
|
||||
public Sprite[] sprites;
|
||||
public float frameTime = 0.75f;
|
||||
|
||||
private void Awake() {
|
||||
renderer = GetComponent<SpriteRenderer>();
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
var frameindex = Mathf.FloorToInt(Time.time / frameTime);
|
||||
renderer.sprite = sprites[frameindex % sprites.Length];
|
||||
}
|
||||
|
||||
}
|
11
Assets/RealCode/Animations/SimpleAnimationLoop.cs.meta
Normal file
11
Assets/RealCode/Animations/SimpleAnimationLoop.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ab68913b04318744b5be4144a001b08
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
26
Assets/RealCode/Animations/SimpleScrollLoop.cs
Normal file
26
Assets/RealCode/Animations/SimpleScrollLoop.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SimpleScrollLoop : MonoBehaviour {
|
||||
|
||||
public float width = 8.75f;
|
||||
public float speed = 1f;
|
||||
private float value = 0f;
|
||||
|
||||
public Transform one, two;
|
||||
|
||||
private void Update() {
|
||||
if (speed > 0) {
|
||||
one.localPosition = new Vector3(value - width, 0f, 0f);
|
||||
two.localPosition = new Vector3(value, 0f, 0f);
|
||||
} else {
|
||||
one.localPosition = new Vector3(value + width, 0f, 0f);
|
||||
two.localPosition = new Vector3(value, 0f, 0f);
|
||||
}
|
||||
|
||||
|
||||
value += Time.deltaTime * speed;
|
||||
value %= width;
|
||||
}
|
||||
}
|
11
Assets/RealCode/Animations/SimpleScrollLoop.cs.meta
Normal file
11
Assets/RealCode/Animations/SimpleScrollLoop.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 90fbb72b07a62ea448ce550144c094c6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue