Esempio n. 1
0
    void Start()
    {
        _RB      = GetComponent <Rigidbody>();
        _Pos     = transform.position;
        _Echidna = FindObjectOfType <EchidnaController>();

        gameObject.layer = SRLayers.Players;
    }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        PlayerController[] players = FindObjectsOfType <PlayerController>();
        EchidnaController  echidna = FindObjectOfType <EchidnaController>();

        _TransformsToKeepInFocus.Add(echidna.transform);
        _TransformsToKeepInFocus.Add(players[0].transform);
        _TransformsToKeepInFocus.Add(players[1].transform);
    }
Esempio n. 3
0
    void OnCollisionEnter(Collision collision)
    {
        EchidnaController echidna = collision.gameObject.GetComponent <EchidnaController>();

        if (echidna != null)
        {
            echidna.BeginInteraction(this);
            SetState(State.PushingEchidna);
        }
    }
Esempio n. 4
0
    void Initialise()
    {
        PlayerController[] players = FindObjectsOfType <PlayerController>();
        EchidnaController  echidna = FindObjectOfType <EchidnaController>();

        _TransformsToKeepInFocus.Add(echidna.transform);
        _TransformsToKeepInFocus.Add(players[0].transform);
        _TransformsToKeepInFocus.Add(players[1].transform);

        UpdateAverage();

        _Initialised = true;
    }
Esempio n. 5
0
    void BeginInteraction(Interactable interactable)
    {
        if (_Debug)
        {
            print(name + " begun interaction with " + interactable.gameObject.name + "  from layer " + interactable.gameObject.layer.ToString());
        }

        if (interactable.gameObject.layer == SRLayers.Echidna)
        {
            SetState(State.InteractingEchidna);
            EchidnaController echidna = _ActiveInteractable.gameObject.GetComponent <EchidnaController>();
        }
        else if (interactable.gameObject.layer == SRLayers.Interactables)
        {
            SetState(State.InteractingEnvironment);
        }

        _ActiveInteractable = interactable;
        _ActiveInteractable.BeginInteraction(this);
    }