当前位置: 首页>>代码示例>>C#>>正文


C# Critter类代码示例

本文整理汇总了C#中Critter的典型用法代码示例。如果您正苦于以下问题:C# Critter类的具体用法?C# Critter怎么用?C# Critter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Critter类属于命名空间,在下文中一共展示了Critter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Activate

 public void Activate(Critter newCritter)
 {
     if(hex){
         critter = newCritter;
         UpdateInfo();
     }
 }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:7,代码来源:HexButton.cs

示例2: SetCritter

 private void SetCritter()
 {
     if (!critter)
     {
         critter = FindObjectOfType<Player>().GetCritter();
     }
 }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:7,代码来源:CritterEventEffects.cs

示例3: PopulateTokenSpriteOptions

    public static List<Sprite> PopulateTokenSpriteOptions(Critter.locomotionType[] locomotions)
    {
        List<Sprite> finalSpriteList = new List<Sprite>();
        Sprite[] currentList;
        string itemLocation = "";

        foreach (Critter.locomotionType locoType in locomotions)
        {
            itemLocation = CheckTokenImageLocationString(locoType);
            currentList = Resources.LoadAll<Sprite>(itemLocation);

            currentList = pUnlocksControl.GenerateUnlockedSpriteList(currentList);

            foreach (Sprite item in currentList)
            {
                if (!finalSpriteList.Contains(item))
                {
                    finalSpriteList.Add(item);
                }
            }
        }
        finalSpriteList.TrimExcess();

        return finalSpriteList;
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:25,代码来源:GameController.cs

示例4: Activate

    public void Activate(Critter newCritter, Hex newHab)
    {
        critter = newCritter;
        habitat = newHab;

        warnControl = FindObjectOfType<WarningsController>();
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:7,代码来源:WarningChecker.cs

示例5: Init

        public static void Init(Critter ghost, bool firstTime)
        {
            if(firstTime)
            {
                // set max possible HP
                ghost.Stat[Stats.MaxLife] = 9999;
                ghost.Stat[Stats.CurrentHP] = 9999;
                // and armor class
                ghost.Stat[Stats.ArmorClass] = 90;
            }

            // syncronize ghost actual state with var value
            if(ghost.Cond == Cond.Dead && GhostState == State.Alive )
            {
                ghost.ToLife();
            }
            else if(ghost.Cond != Cond.Dead && GhostState == State.Dead)
            {
                ghost.ToDead(Anim2.DeadBurnRun, null);
            }

            ghost.Attacked += _GhostAttacked;
            ghost.Dead += _GhostDead;
            ghost.Respawn += (self, e) => GhostState = State.Alive;
            ghost.Stealing += _GhostStealing;
        }
开发者ID:wladimiiir,项目名称:vault112,代码行数:26,代码来源:Ghost.cs

示例6: SetCritterTransformArray

    public void SetCritterTransformArray(Critter sourceCritter) {
        critter = sourceCritter;
        critterDecorationsTest.critter = sourceCritter;

        critterSegmentTransforms = new SegmentTransform[sourceCritter.critterSegmentList.Count];  // grab numSegments from Critter

        for(int i = 0; i < sourceCritter.critterSegmentList.Count; i++) {
            SegmentTransform segmentTransform;
            segmentTransform.PX = sourceCritter.critterSegmentList[i].transform.position.x;
            segmentTransform.PY = sourceCritter.critterSegmentList[i].transform.position.y;
            segmentTransform.PZ = sourceCritter.critterSegmentList[i].transform.position.z;
            segmentTransform.RX = sourceCritter.critterSegmentList[i].transform.rotation.x;
            segmentTransform.RY = sourceCritter.critterSegmentList[i].transform.rotation.y;
            segmentTransform.RZ = sourceCritter.critterSegmentList[i].transform.rotation.z;
            segmentTransform.RW = sourceCritter.critterSegmentList[i].transform.rotation.w;
            segmentTransform.SX = sourceCritter.critterSegmentList[i].transform.localScale.x / 2f;
            segmentTransform.SY = sourceCritter.critterSegmentList[i].transform.localScale.y / 2f;
            segmentTransform.SZ = sourceCritter.critterSegmentList[i].transform.localScale.z / 2f;
            critterSegmentTransforms[i] = segmentTransform;
        }
        //Debug.Log("SetCritterTransformArray numSegments: " + critterSegmentTransforms.Length + ", BoundingBox: " + sourceCritter.BoundingBoxMinCorner.ToString() + " -> " + sourceCritter.BoundingBoxMaxCorner.ToString());

        // Largest boundingBox dimension determines cellResolution?
        GlobalBoundingBoxDimensions = (sourceCritter.BoundingBoxMaxCorner - sourceCritter.BoundingBoxMinCorner) * 1.15f;  // buffer amount
        GlobalBoundingBoxOffset = (sourceCritter.BoundingBoxMaxCorner + sourceCritter.BoundingBoxMinCorner) / 2f;        
        int approxChunksPerDimension = 5;
        float avgRadius = (GlobalBoundingBoxDimensions.x + GlobalBoundingBoxDimensions.y + GlobalBoundingBoxDimensions.z) / 3f;
        float chunkSize = avgRadius / (float)approxChunksPerDimension;
        float cellSize = chunkSize / 8f;
        cellResolution = cellSize;        
    }
开发者ID:eaclou,项目名称:Master_CreatureTrainer01,代码行数:31,代码来源:CritterMarchingCubes.cs

示例7: Mutate

        /// <summary>
        /// Mutates a critter
        /// </summary>
        /// <param name="child">
        /// The critter that is to be mutated. 
        /// </param>
        /// <returns>
        /// A mutated critter. 
        /// </returns>
        public Critter Mutate(Critter child)
        {
            var rand = Random.GetInstance();
            double u1 = rand.NextDouble(); // these are uniform(0,1) random doubles
            double u2 = rand.NextDouble();
            double randStdNormal = Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2); // random no

            int crossoverWeight = (int)Tools.Clamp(10 * randStdNormal, -30, 30);

            child.DepartureTime = this.properties.DepartureTime.AddMinutes(crossoverWeight);
            Assert.That(child.DepartureTime != default(DateTime));

            var random = Random.GetInstance();
            List<NodeWrapper<INetworkNode>> nodes = child.Route;
            if (nodes.Count == 1)
            {
                return child;
            }

            int startIndex = random.Next(0, nodes.Count - 2);
            int endIndex = random.Next(startIndex + 1, nodes.Count - 1);
            NodeWrapper<INetworkNode> begin = nodes[startIndex];
            NodeWrapper<INetworkNode> end = nodes[endIndex];
            Route newSegment = this.properties.RouteGenerator.Generate(
                begin.Node, end.Node);
            var newRoute = new Route(Guid.NewGuid().GetHashCode());
            newRoute.AddRange(nodes.GetRange(0, startIndex));
            newRoute.AddRange(newSegment);
            newRoute.AddRange(nodes.GetRange(endIndex + 1, nodes.Count - 1 - endIndex));

            return new Critter((Route)newRoute.Clone(), new Fitness()) { DepartureTime = child.DepartureTime };

            // return child;
        }
开发者ID:NoxHarmonium,项目名称:rmitjourneyplanner,代码行数:43,代码来源:StandardMutator.cs

示例8: Awake

    void Awake ()
    {
        crit = GetComponent<Critter>();

        if (sfx == null)
            sfx = GameObject.Find("Audio/AudioSFX").GetComponent<AudioSource>();
    }
开发者ID:bartochnio,项目名称:Rytuol,代码行数:7,代码来源:GoatScript.cs

示例9: Activate

    public void Activate(Critter newCritter)
    {
        critter = newCritter;

        slotIcons = GetComponentsInChildren<UISlot>();

        InitializeSlots(critter, slotType);
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:8,代码来源:TraitUIPanel.cs

示例10: Activate

    public void Activate()
    {
        if (!playerCritter) { playerCritter = FindObjectOfType<Player>().GetCritter(); }
        mainPanel.SetActive(true);
        subPanel.Activate();

        gameObject.SetActive(true);
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:8,代码来源:EvoTree.cs

示例11: Activate

    public void Activate(Critter critter, Adaptation.BodySlot newType)
    {
        gameObject.SetActive(true);

        InitializeSlots(critter, newType);

        PopulatePanel();
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:8,代码来源:SubPanelInfo.cs

示例12: Activate

    public void Activate(Critter newCritter)
    {
        critter = newCritter;

        if (critter) {
            PopulateLocalCritterList();
        }
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:8,代码来源:AdaptationListUI.cs

示例13: GetTokenSpriteOptions

    public static Sprite[] GetTokenSpriteOptions(Critter critter)
    {
        Critter.locomotionType[] locomotions = critter.GetLocomotion();

        tokenSpriteOptions = PopulateTokenSpriteOptions(locomotions).ToArray();

        return tokenSpriteOptions;
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:8,代码来源:GameController.cs

示例14: Activate

    public void Activate(Critter newCritter, Hex newHab, WarningChecker.warningType newType, Sprite newSprite, Color32 color)
    {
        icon = GetComponentsInChildren<Image>()[1];

        type = newType;

        icon.sprite = newSprite;
        icon.color = color;
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:9,代码来源:WarningIcon.cs

示例15: Start

    void Start()
    {
        critterGen = FindObjectOfType<CritterGenerator>();
        myCritter = gameObject.GetComponent<Critter>();

        cloneCritter = false;
        splitTimer = timerResetVal;
        currentTurn = TurnTimer.currentTurn;
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:9,代码来源:EvolutionList.cs


注:本文中的Critter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。