Exemple #1
0
    public bool BindIcon(SacredIcon icon)
    {
        bool done          = false;
        Icon situationIcon = Icon(Glyph.Categories.situation);

        Debug.Log("BindIcon called for sacred icon");
        if (situationIcon != null)
        {
            Debug.Log("... and situation icon ain't null");
            Rigidbody situationIconBody = situationIcon.gameObject.GetComponent <Rigidbody>();
            if (situationIcon.Glyph().Situation().DeitiesRequired() > sacredIcons.Count)
            {
                done = true;
                icon.Episode(this);
                icon.BindTo(situationIconBody);
                sacredIcons.Add(icon);
            }
        }
        else
        {
            Debug.Log("Sacred icons can't be bound without a set situation glyph");
            Cancel();
        }
        return(done);
    }
Exemple #2
0
    private void OnCollisionEnter(Collision collision)
    {
        Icon       collidingIcon       = collision.gameObject.GetComponent <Icon>();
        SacredIcon collidingSacredIcon = collision.gameObject.GetComponent <SacredIcon>();

        if (collidingIcon != null)
        {
            Glyph collidingGlyph = collidingIcon.Glyph();
            if (collidingGlyph.Category() == Glyph.Categories.situation && episode == null)
            {
                Stage.instance.StartEpisode(this, collidingIcon);
            }
            if (episode != null)
            {
                episode.BindIcon(collidingIcon);
            }
        }
        if (collidingSacredIcon != null)
        {
            if (episode != null && collidingSacredIcon.Episode() == null)
            {
                episode.BindIcon(collidingSacredIcon);
            }
        }
    }