Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        if (!mech)
        {
            mech = gameObject;
        }
        lr = mech.GetComponent <LineRenderer>();

        MM = GameObject.Find("InputManager").GetComponent <MechMovement>();
    }
Beispiel #2
0
    void Start()
    {
        openPos      = doors.transform.position;
        closedPos    = openPos;
        closedPos.y += 30;

        baseClosePos   = baseDoors.transform.position;
        baseOpenPos    = baseClosePos;
        baseOpenPos.y -= 30;

        mechMovement = mech.GetComponent <MechMovement>();
    }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (!MM)
        {
            MechMovement MM = GameObject.Find("InputManager").GetComponent <MechMovement>();
            mech = MM.mech;
            return;
        }

        rotateSpeed = MM.rotateSpeed;
        moveSpeed   = MM.moveSpeed;

        if (Time.time > nextActionTime)
        {
            nextActionTime += period;
            RenderPath();
        }

        mech.transform.Translate(0, 0, Time.deltaTime * moveSpeed, Space.Self);
        mech.transform.Rotate(0, Time.deltaTime * rotateSpeed, 0, Space.Self);
    }
Beispiel #4
0
 // Start is called before the first frame update
 void Start()
 {
     this.mechMovement = GetComponent <MechMovement>();
     this.audioSource  = GetComponent <AudioSource>();
 }
Beispiel #5
0
 private void Awake()
 {
     this.spin         = GetComponentInChildren <SpinToWin>();
     this.hammyRun     = GetComponentInChildren <HammyRun>();
     this.mechMovement = GetComponentInParent <MechMovement>();
 }