Merge pull request #24 from frizbee19/beni

2019 Honda Civic LX (car)
This commit is contained in:
Benji
2022-02-27 02:46:32 -06:00
committed by GitHub
3 changed files with 3769 additions and 159 deletions
File diff suppressed because it is too large Load Diff
+21 -4
View File
@@ -2,16 +2,33 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum TestingBehavior {
Cycle,
Set
};
public class AnimationControllerTester : MonoBehaviour {
public Animator animator;
public int numberOfAnimations = 1;
public string animationPropertyName = "Animation";
public TestingBehavior behavior = TestingBehavior.Cycle;
public int setAnimationIndex = 0;
void Start() {
if (animator == null) {
animator = GetComponent<Animator>();
}
}
// Update is called once per frame
void Update() {
// Get current time
int second = (int) (Time.time / 1.5f);
int animationIndex = second % numberOfAnimations;
animator.SetInteger(animationPropertyName, animationIndex);
if (behavior == TestingBehavior.Cycle) {
// Get current time
int second = (int) (Time.time / 1.5f);
int animationIndex = second % numberOfAnimations;
animator.SetInteger(animationPropertyName, animationIndex);
} else {
animator.SetInteger(animationPropertyName, setAnimationIndex);
}
}
}
+4 -2
View File
@@ -3,12 +3,14 @@ using System.Collections.Generic;
using UnityEngine;
public class WaterSpirit : MonoBehaviour {
private Transform player;
public BoxCollider2D boxCollider;
public float swimSpeed = .25f;
private BoxCollider2D boxCollider;
private Transform player;
private Rigidbody2D rb;
private Vector2 movement = Vector2.zero;
private float sizeOffset = 1;
private bool activated = false;
void Start() {
rb = this.GetComponent<Rigidbody2D>();