Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Rice Shower

A topic by saitot created Feb 12, 2019 Views: 1,403 Replies: 41
Viewing posts 1 to 20 of 39 · Next page · Last page
Submitted

Hello from TAMA in Tokyo!

am H.T.SAITO as saitot, the other member will join soon :)

Now it's 21:00 JST, the Jam will start from 2:00 am hahaha

Submitted (1 edit)

Members of YDK, DFO, M@GIC★ and Rice Shower

Host

Seems we have a winner's team there! :-)

Submitted
Submitted

Submitted

Host

Hi guys,

Thank you for the photo! Keep on going!

Submitted

Thank you ! We 're enjoying the situation.


Submitted

Host

thank you

Submitted

Host

Thanks

Submitted

Submitted

Host

Thanks

Host

Thank you!

Host

Hello there !

Is everything ok ? Don't forget to post your WIP.

Thank you for the photo of your teams ! I'll post it on Facebook soon !

Bonsor, the active developer has switched and I could not access here until now.

Everything is fine for us, unless that we are working in turn and the photo of all the member would be very hard now. 

A bientot

(1 edit)

The abstract class that I made within last two hours:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
abstract public class TriggerAction : MonoBehaviour
{
    bool lastTriggerState;
    // Start is called before the first frame update
    void Start()
    {
        lastTriggerState = gameObject.GetComponent<TriggerManager>().isTriggered;
    }
    // Update is called once per frame
    void Update()
    {
        if (gameObject.GetComponent<TriggerManager>().isTriggered)
            if (lastTriggerState == false)
            {
                lastTriggerState = true;
                OnTriggered();
            }
            else
            {
                TriggeredUpdate();
            }
    }
    protected abstract void OnTriggered();
    protected abstract void TriggeredUpdate();
}
(1 edit)

Sample code to use TriggerAction abstract class:

public class TriggerActionFly : TriggerAction
{
    protected override void OnTriggered()
    {
        gameObject.GetComponent<Renderer>().material.color = Color.red;
    }
    protected override void TriggeredUpdate()
    {
        gameObject.transform.position += Vector3.right * 0.1f;
    }
}

The TriggerManager class to determine if the object is triggered:

public class TriggerManager : MonoBehaviour
{
    public bool isTriggered = false;
    public bool requireZoom;
    public TriggerManager[] prerequisites;     // Start is called before the first frame update
    void Start()
    {     }     // Update is called once per frame
    void Update()
    {
        
    }     public bool pullTrigger(bool isZoomed)
    {
        // ズームでのトリガを要求するオブジェクトが、非ズーム状態で呼ばれても無視。
        if (requireZoom && !isZoomed)
            return false;         // 前提条件オブジェクトが、トリガを引かれていない状態で存在するならば
        // トリガは引かれない。
        for (int i = 0; i < prerequisites.Length; i++)
            if (prerequisites[i] != null && !prerequisites[i].isTriggered)
                return false;         // ここまで来たら、自分のトリガを引く。
        isTriggered = true;
        return true;
    }
}
Viewing posts 1 to 20 of 39 · Next page · Last page