Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     robot     = GameObject.Find("Robot").GetComponent <SimpleMovement>();
     ph        = GameObject.Find("Robot").GetComponent <PlayerHUD>();
     direction = "horizontal";
     sr        = GetComponent <SpriteRenderer> ();
     capcol    = robot.GetComponent <CapsuleCollider2D> ();
     boxcol    = this.GetComponent <BoxCollider2D> ();
 }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 void Throw()
 {
     playerMovement.transform.SetParent(null);
     playerMovement.transform.position = new Vector3(-0.125f, 0.995f, -3.442f);
     playerMovement.transform.rotation = Quaternion.Euler(0, 0, 0);
     playerMovement.playing            = true;
     playerMovement.enabled            = true;
     playerMovement.GetComponent <Rigidbody>().isKinematic = false;
     cinemachineFreeLook.Follow = playerMovement.transform;
     cinemachineFreeLook.LookAt = playerMovement.transform;
 }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     robot = GameObject.Find("Robot").GetComponent <SimpleMovement>();
     ph    = GameObject.Find("Robot").GetComponent <PlayerHUD>();
     Debug.Log("OIL STARTED!!!!!");
     direction   = "right";
     is_right    = true;
     onGround    = true;
     velocityNow = new Vector2(speed, 0);
     this.GetComponent <Rigidbody2D> ().velocity = velocityNow;
     sr                 = GetComponent <SpriteRenderer> ();
     capcol             = robot.GetComponent <CapsuleCollider2D> ();
     boxcol             = this.GetComponent <BoxCollider2D> ();
     xStart             = this.transform.position.x;
     xLast              = xStart;
     startRocketHitTime = Time.time - hitRocketTime;
     startBulletHitTime = Time.time - hitBulletTime;
 }