void Start() { //Set default values fl_MaxHealth = 10f; fl_Health = fl_MaxHealth; fl_InvisMaxEffect = 5f; fl_InvisEffect = fl_InvisMaxEffect; fl_InvisCooldown = 0f; bl_Instructions = false; bl_Invis = false; bl_InvisCooldown = false; //Find the level map and obtain the script LM_Script = GameObject.Find("Level_Map").GetComponent <TL_LevelMediator>(); //Find the data recorder and obtain the script DataScript = GameObject.Find("Data_Recorder").GetComponent <TL_RecordData>(); //Obtain the material from the renderer mt_PC = GetComponent <Renderer>().material; //Find the standard AI button in the canvas StandardAIButton = GameObject.Find("PC_Cam(Clone)/Canvas/ChoiceBox/StandardAIButton").GetComponent <Button>(); //Set the function of the button from the level manager StandardAIButton.onClick.AddListener(delegate { LM_Script.StandardAIMode(); }); //Find the dynamic AI button in the canvas DynamicAIButton = GameObject.Find("PC_Cam(Clone)/Canvas/ChoiceBox/DynamicAIButton").GetComponent <Button>(); //Set the function of the button from the level manager DynamicAIButton.onClick.AddListener(delegate { LM_Script.DynamicAIMode(); }); }
void Start() { //Set initial values st_NPC_State = "Patrol"; st_NPC_PrevState = st_NPC_State; fl_NPC_MaxHealth = 8f; fl_NPC_Health = fl_NPC_MaxHealth; fl_NPC_Attack = 2f; fl_Attack_Range = 4f; in_CurrentWaypoint = 0; //Create the text mesh and set the position go_TextMeshClone = Instantiate(go_TextMesh, new Vector3(transform.position.x, transform.position.y + 2f, transform.position.z), Quaternion.identity); //Set the rotation go_TextMeshClone.transform.eulerAngles = new Vector3(90, -90, 0); //Obtain the Nav Mesh Agent component nm_Agent = GetComponent <NavMeshAgent>(); //Set default target position v3_NPC_TargetPos = transform.position; //Locate gameobjects and obtain their components LineOfSightScript = GetComponentInChildren <TL_NPCLineOfSight>(); LM_Script = GameObject.Find("Level_Map").GetComponent <TL_LevelMediator>(); DataScript = GameObject.Find("Data_Recorder").GetComponent <TL_RecordData>(); go_PC = GameObject.Find("pf_PC(Clone)"); PCScript = go_PC.GetComponent <TL_PCStats>(); }
void Start() { //Find the level map and obtain the script LM_Script = GameObject.Find("Level_Map").GetComponent <TL_LevelMediator>(); //Obtain the character controller cc_PC = GetComponent <CharacterController>(); //Set default speed fl_PCSpeed = 4.5f; }
void Start() { //Locate the PC PC = GameObject.FindGameObjectWithTag("PC"); //Obtain the script from the parent gameobject NPCScript = GetComponentInParent <TL_NPC_FSM>(); //Locate the gameobjects and obtain their scripts PCScript = PC.GetComponent <TL_PCStats>(); LM_Script = GameObject.Find("Level_Map").GetComponent <TL_LevelMediator>(); DataScript = GameObject.Find("Data_Recorder").GetComponent <TL_RecordData>(); }
void Start() { //Find the level map and obtain the level mediator LM_Script = GameObject.Find("Level_Map").GetComponent <TL_LevelMediator>(); }