private void ExtrudeFace() { float step = 4 * Time.deltaTime; AbilityFace.Parent.position = Vector3.MoveTowards(AbilityFace.Parent.position, targetPos, step); if (xMove) { cScript.MoveFace("XPlus", AbilityFace.Parent.position.x); } else { cScript.MoveFace("ZPlus", AbilityFace.Parent.position.z); } if (Vector3.Distance(AbilityFace.Parent.position, targetPos) < .005f) { cubeChild.transform.SetParent(AbilityFace.transform); AbilityFace.Parent.position = targetPos; SpawnFace(); IsActing = false; StartCoroutine(DelayedScan()); } }
private void RaiseFace() { float step = 4 * Time.deltaTime; AbilityFace.Parent.position = Vector3.MoveTowards(AbilityFace.Parent.position, targetHeight, step); cScript.MoveFace("YPlus", AbilityFace.Parent.position.y); if (Vector3.Distance(AbilityFace.Parent.position, targetHeight) < .005f) { heightSet = true; cubeChild.transform.SetParent(AbilityFace.transform); AbilityFace.Parent.position = targetHeight; AstarPath.active.Scan(); } }
private void RaiseCube() { cScript.MoveFace("YPlus", AbilityFace.Parent.position.y); }