コード例 #1
0
    // InstantiateSignal()
    // create a signal that subtracts
    public GameObject InstantiateSignal(float size, string mod, float modifier, bool hitall, bool hitself)
    {
        GameObject        obtainSurroundings = Instantiate(Checks.signalPrefab, transform.position, Quaternion.identity, transform) as GameObject;
        SignalApplication signalModifier     = obtainSurroundings.GetComponent <SignalApplication>();

        signalModifier.SetSignalParameters(this.gameObject, size, new Dictionary <string, float>()
        {
            { mod, modifier }
        }, hitall, hitself);
        return(obtainSurroundings);
    }
コード例 #2
0
    /// <summary>
    /// for every creature in the nearbycreatures list, inserts them into a dictionary with (Collider2D : character data)
    /// </summary>
    public void AwareNearby()
    {
        // clear all creatues
        AllCreatures.Clear();
        // update all creatures
        GameObject        obtainSurroundings = Instantiate(signalPrefab, this.transform.position, Quaternion.identity) as GameObject;
        SignalApplication signalModifier     = obtainSurroundings.GetComponent <SignalApplication>();

        signalModifier.SetSignalParameters(this.gameObject, AiData.Perception, new Dictionary <string, float>()
        {
        }, true, false);
        AiData.Awareness = signalModifier;
        // the signal will notify the signal creator of this data once it is dead
    }