private void Awake() { actCtrl = GetComponent <Actor_Controller>(); GameObject model = actCtrl.model; GameObject sensor = null; try { sensor = transform.Find("sensor").gameObject; } catch (System.Exception) { // // if there is no sensor object // } btlMgr = Bind <BattleMgr>(sensor); wpnMrg = Bind <WeaponMgr>(model); staMgr = Bind <StateMgr>(gameObject); dirMgr = Bind <DirectorMgr>(gameObject); intMgr = Bind <InterationMgr>(sensor); actCtrl.OnAction += DoAction; }
void Awake() { ac = GetComponent <Actor_Controller>(); GameObject model = ac.model; GameObject sensor = null; try { sensor = transform.Find("Sensor").gameObject; } catch (System.Exception ex) { // // If there is no "sensor" object // } bm = Bind <BattleManager>(sensor); wm = Bind <WeaponManager>(model); sm = Bind <StateManager>(gameObject); dm = Bind <DirectorManager>(gameObject); im = Bind <InteractionManager>(sensor); //sm.Test(); ac.OnAction += DoAction; }
//FIXME: this should not be called every frame but just when the actor changes! Event system... void FixedUpdate() { _parentGO = this.gameObject; _parentActor = _parentGO.GetComponent <Actor_Controller>(); if (_parentActor) { _parentGender = _parentActor.actorData.breedData.gender; _parentMaterial = this.GetComponent <MeshRenderer>().material; switch (_parentGender) { case Actor_Gender.male: _color = Color.blue; break; case Actor_Gender.female: _color = Color.red; break; //case Actor_Gender.solo: // _color = Color.green; break; case Actor_Gender.both: _color = Color.yellow; break; case Actor_Gender.none: _color = Color.grey; break; } _parentMaterial.color = _color; } }
private void Awake() { parentGO = this.gameObject; actorController = parentGO.GetComponent <Actor_Controller>(); parentCollider = parentGO.GetComponent <CapsuleCollider>(); parentRigidbody = parentGO.GetComponent <Rigidbody>(); }
void Awake() { if (_actor == null) { _actor = this.GetComponent <Actor_Controller>(); } _gameObject = _actor.gameObject; _actor_Data = _actor._ActorData; _transform = _actor.gameObject.transform; _headTransfrom = _actor._Bone_Head; _rigidbody = _actor.gameObject.GetComponent <Rigidbody>(); _colliderCapsule = _actor.gameObject.GetComponent <CapsuleCollider>(); _colliderTransform = _colliderCapsule.transform; _colliderYbounds = _colliderCapsule.bounds.extents.y; //bounding box distance from center to box _colliderCenter = _colliderCapsule.center; _State_MovementSpeed = State_MovementSpeed.walkSpeed; _State_Terrain = State_Terrain.ground; _State_Sliding = State_Sliding.notSliding; _State_Ragdoll = State_IsRagdoll.notRagdolled; _State_Headspace = State_Headspace.canStand; _State_LatchedSurface = State_LatchedSurface.noSurface; _remaining_Multijumps = _actor_Data._NumJumps; }
void Awake() { if (_actor == null) { _actor = this.GetComponent <Actor_Controller>(); } _transform = _actor.transform; _movementController = _actor._MovementController; _camera = _actor._camera; }
//FIXME: this should not be called every frame but just when the actor changes! Event system... void FixedUpdate() { _parentActor = _parentGO.GetComponent <Actor_Controller>(); if (_parentActor) { _text = _parentActor.actorData.name; //INFO: stringbuilder is faster since you can set the max size and dont have to reallocate, but not worth for debugging _text += "\n Age: " + _parentActor.actorData.ageInSeconds + "/" + _parentActor.actorData.ageInSecondsMax; _text += "\n Gender: " + _parentActor.actorData.breedData.gender.ToString(); _textGO.transform.position = this.transform.position + Vector3.up * height; _textGO.transform.rotation = _cam.transform.rotation; _textmesh.text = _text; } }
void Start() { cameraHandle = transform.parent.gameObject; playerHandle = cameraHandle.transform.parent.gameObject; Actor_Controller ac = playerHandle.GetComponent <Actor_Controller>(); model = ac.model; tempEulerX = 20; pi = ac.pi; if (!isAI) { _camera = Camera.main.gameObject; lockDot.enabled = false; Cursor.lockState = CursorLockMode.Locked; } }
//FIXME: this should not be called every frame but just when the actor changes! Event system... void FixedUpdate() { _parentGO = this.gameObject; _parentActor = _parentGO.GetComponent <Actor_Controller>(); //the actor data can chang so recheck it if (_parentActor) { isAlive = _parentActor.actorData.Alive; if (isAlive) { this.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); } else { this.transform.localScale = new Vector3(1.0f, 0.3f, 1.0f); } } }
private void Awake() { anim = GetComponent <Animator>(); ac = GetComponentInParent <Actor_Controller>(); }
protected void Start() { playerActorController = Player_Manager.singleton.mainPlayer.actorController; playerMovementController = Player_Manager.singleton.mainPlayer.actorController.actorMovementController; playerGO = playerActorController.gameObject; }