public void Input2() { print("2"); //Code for selecting the input 2 here. GameObject player = GameObject.FindGameObjectWithTag("Player"); GeneralPlayerMovement gpm = player.GetComponent <GeneralPlayerMovement>(); gpm.ChangeMovements(1); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player").transform; GMP = player.GetComponent <GeneralPlayerMovement>(); cameraTimer = CameraMoveTime; CamMin = GameObject.Find("CameraMin").transform; CamMax = GameObject.Find("CameraMax").transform; aspect = Camera.main.aspect; }
//public int fatherLife = 100; //[Header("")] public void Start() { JumpableLayers = LayerMask.GetMask("Ground", "WallJump", "Default"); // setting vars rb = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); gpm = GetComponent <GeneralPlayerMovement>(); objectPooler = ObjectPooler.instance; // setting abilities GiveAbbility(); }
private void Start() { OnMovablePlatform = false; JumpableLayers = LayerMask.GetMask("Ground", "WallJump", "Default"); // setting vars rb = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); gpm = GetComponent <GeneralPlayerMovement>(); // setting abilities GiveAbbility(); }
// Use this for initialization void Start() { transform.GetChild(0).GetComponent <Canvas>().worldCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); curShardCount = StartShards; GPM = GameObject.FindGameObjectWithTag("Player").GetComponent <GeneralPlayerMovement>(); curChar = GPM.characterSelected; // assign one and ten GameObject HolderOfSpritRenderer = GameObject.FindGameObjectWithTag("AbilityWheel").transform.GetChild(0).gameObject; //One = HolderOfSpritRenderer.transform.GetChild(0).GetComponent<SpriteRenderer>(); //Ten = HolderOfSpritRenderer.transform.GetChild(1).GetComponent<SpriteRenderer>(); // assign the nr UpdateNumbers(curShardCount); }
private void OnTriggerEnter2D(Collider2D collision) { respawnGo = collision.gameObject; objectPooler.killGameObject(respawnGo); Box boxScript = collision.gameObject.GetComponent <Box>(); GeneralPlayerMovement playerScript = collision.gameObject.GetComponent <GeneralPlayerMovement>(); if (boxScript != null) { respawnPos = boxScript.getStartPosition(); objectPooler.spawnSpecificFromPool(respawnGo, respawnPos, respawnGo.transform.rotation); } if (playerScript != null) { //respawnPos = playerScript.getStartPosition(); //objectPooler.spawnSpecificFromPool(respawnGo, respawnPos, respawnGo.transform.rotation); GameManager.instance.instaKill(); } }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D>(); script = GetComponent <GeneralPlayerMovement>(); }