// Start is called before the first frame update void Start() { base.Start(); isOnTurn = false; if (powerIndicator == null) { try{ powerIndicator = GameObject.Find("PowerIndicator").GetComponent <Slider>(); } catch (Exception e) { } } if (prevPowerIndicator == null) { try{ prevPowerIndicator = GameObject.Find("PreviousPowerIndicator").GetComponent <Slider>(); } catch (Exception e) { } } // angleIndicatorAnchor = transform.GetChild(2).GetComponent<Transform>().position; // angleIndicator = transform.GetChild(1).GetComponent<Transform>(); if (handRotator == null) { try{ handRotator = GameObject.Find("AngleHand").GetComponent <HandRotator>(); } catch (Exception e) { } } if (uiController == null) { try{ uiController = GameObject.Find("UIController").GetComponent <FightUIController>(); } catch (Exception e) { } } handRotator.SetIsHeadRight(this.isHeadingRight); // try { // virtualRigidBody = GameObject.Find("VirtualRigidbody").GetComponent<VirtualRigidbodyHandler>(); // } catch(Exception e){ // Debug.Log("Err: "+ e); // } indicatorRotator = this.FindChildObject("AngleIndicator"); angleIndicator = indicatorRotator.GetComponent <AngleIndicatorController>(); angleBackground = this.FindChildObject("AngleBackground"); fightInfoDisplay = GameObject.Find("PlayerFightInfo").GetComponent <PlayerFightInfoDisplay>(); // if (virtualRigidBody != null){ // Debug.Log("VRB != NULL"); // Destroy(virtualRigidBody.gameObject); // } else { // } // GameObject vrb = Instantiate(virtualRigidbodyPrefab,this.transform.position,Quaternion.identity); // virtualRigidBody = vrb.GetComponent<VirtualRigidbodyHandler>(); // virtualRigidBody.mpc = this; isHeadingRight = (this.transform.rotation.eulerAngles.x < 179f); // moveSlowMultiply = new Vector2(0.8f,0f); // fireAngle = 20; // handRotator.SetAngle(fireAngle); firePower = 0; timer = 0f; // rigidBody.simulated = true; //anim = transform.GetChild(1).gameObject.GetComponent<Animator>(); }
void Start() { handRotator = GameObject.Find("AngleHand").GetComponent <HandRotator>(); this.transform.RotateAround(angleBackground.transform.position, transform.forward, 20); }