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

        gameObject.layer = SRLayers.Players;
    }
예제 #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);
    }
예제 #3
0
    void OnCollisionEnter(Collision collision)
    {
        EchidnaController echidna = collision.gameObject.GetComponent <EchidnaController>();

        if (echidna != null)
        {
            echidna.BeginInteraction(this);
            SetState(State.PushingEchidna);
        }
    }
예제 #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;
    }
예제 #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);
    }