public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        CultistController CC = (CultistController)target;

        EditorUtility.SetDirty(CC);
        EditorGUILayout.Separator();
        EditorGUILayout.LabelField("Waypoints");
        foreach (Transform waypoint in CC.waypoints)
        {
            Waypoint = (GameObject)EditorGUILayout.ObjectField(waypoint.gameObject, typeof(GameObject), false);

            if (CC.waypoints.Count > 1)
            {
                if (GUILayout.Button("Delete waypoint", GUILayout.MaxWidth(100f)))
                {
                    CC.waypoints.Remove(waypoint);
                    DestroyImmediate(waypoint.gameObject);
                }
            }
        }
        EditorGUILayout.Separator();
        if (GUILayout.Button("Add waypoint"))
        {
            CC.Addwaypoint();
        }
    }
 void Start()
 {
     cultistController = FindObjectOfType<CultistController>();
     levelAndClockController = FindObjectOfType<LevelAndClockController>();
     soundController = FindObjectOfType<SoundController>();
     pentaMonsta = GameObject.Find("PentaMonsta");
     if (pentaMonsta != null)
     {
         pentaMonsta.GetComponent<SpriteRenderer>().sortingOrder = -10;
     }
 }
Exemple #3
0
    void OnTriggerEnter(Collider other)
    {
        if (!altertable || other.tag != "Player")
        {
            return;
        }

        Collider[] hits = Physics.OverlapSphere(transform.position, alertRadius, alertLayer);
        foreach (Collider hit in hits)
        {
            CultistController controller = hit.gameObject.GetComponent <CultistController> ();
            if (controller != null)
            {
                controller.alerted        = true;
                controller.alertPosistion = this.transform.position;
            }
        }
    }
Exemple #4
0
 void Awake()
 {
     controller = GetComponent <CultistController>();
 }