// Trigger the mole. It is now 'active' and the sprite is set to the default mole sprite, just in case it isn't. public void Trigger(float tl) { sprite.gameObject.SetActive(true); whacked = false; sprite.SetSprite("Mole_Normal"); timeLimit = tl; StartCoroutine(MainLoop()); }
static void DoCreateClippedSpriteObject() { tk2dSpriteGuiUtility.GetSpriteCollectionAndCreate((sprColl) => { GameObject go = tk2dEditorUtility.CreateGameObjectInScene("Clipped Sprite"); tk2dClippedSprite sprite = go.AddComponent <tk2dClippedSprite>(); sprite.SetSprite(sprColl, sprColl.FirstValidDefinitionIndex); sprite.Build(); Selection.activeGameObject = go; Undo.RegisterCreatedObjectUndo(go, "Create Clipped Sprite"); }); }