Beispiel #1
0
    void IMachineListener.OnStateChange(MachineController.MachineState state)
    {
        //Debug.Log ("RandomActivation: OnStateChange: state=" + state.ToString ());

        if (state == MachineController.MachineState.Idle) {
            Global.MachineActivationManager.AddMachineRandomActivator (this);
        }
    }
 public void OnStateChange(MachineController.MachineState state)
 {
     if (state == MachineController.MachineState.Active)
     {
         isActive = true;
         Invoke("DoDammage", 1f);
     }
     else
     {
         isActive = false;
     }
 }
Beispiel #3
0
    void OnStateChanged(MachineController.MachineState state)
    {
        switch (state)
        {
        case MachineController.MachineState.Patrolling:
            flareLight.color = Color.green;
            break;

        case MachineController.MachineState.Alert:
            flareLight.color = Color.yellow;
            break;

        case MachineController.MachineState.Attack:
            flareLight.color = Color.red;
            break;
        }
    }
Beispiel #4
0
    void IMachineListener.OnStateChange(MachineController.MachineState state)
    {
        //Debug.Log ("MachinePlayerInteraction: OnStateChange: state=" + state.ToString ());

        if (state == MachineController.MachineState.Active)
        {
            isActive = true;
        }
        else
        {
            isActive = false;
            if (isInteracting)
            {
                isInteracting    = false;
                interactionTimer = 0f;
                Destroy(progressBar);
                player = null;
            }
        }
    }
Beispiel #5
0
    public void OnStateChange(MachineController.MachineState state)
    {
        if (state == MachineController.MachineState.Active && iconPrefab != null)
        {
            icon = (GameObject)Instantiate(iconPrefab);
            icon.transform.SetParent(mapOverlay.transform, false);

            Vector3 _targetWorldPosition = this.transform.position + relativePosition;
            icon.transform.Translate(_targetWorldPosition);

            icon.transform.rotation = Quaternion.LookRotation(-Camera.main.transform.forward, Camera.main.transform.up);

            isActive   = true;
            blinkTimer = 0f;
        }
        else
        {
            Destroy(icon);

            isActive = false;
        }
    }