コード例 #1
0
 public void addStep(ResearchMethods method)
 {
     if (!StepsTaken.Contains(method))
     {
         StepsTaken.Add(method);
     }
 }
コード例 #2
0
    public void addResearch(ResearchMethods method)
    {
        Hand hand    = this.GetComponent <Hand>();
        var  objects = hand.AttachedObjects;

        //searches for child with Research Manager script
        foreach (var child in objects)
        {
            var             attachedobject = child.attachedObject;
            ResearchManager sn             = attachedobject.GetComponent <ResearchManager>();
            if (sn == null)
            {
                attachedobject.AddComponent <ResearchManager>();
                sn = attachedobject.GetComponent <ResearchManager>();
                sn.StepsRequired = new List <ResearchMethods>();
                sn.StepsTaken    = new List <ResearchMethods>();
            }
            //adds DNA to it
            sn.addStep(method);
        }
    }